public class User {
    public int UserAccount;
    private String password;
    private String Emil;

    public User(int UserAccount,String password) {
        // 不填邮箱
        this.UserAccount = UserAccount;
        this.password = password;
        ShowMeg();
    }
    public User(int UserAccount,String password,String emil) {
        // 填邮箱
        this.UserAccount = UserAccount;
        this.password = password;
        this.Emil = emil;
        ShowMeg();
    }
    public void ShowMeg() {
        String Meg = "账号是：" + Integer.toString(UserAccount) + ",密码是：" + password;
        if(this.Emil != null) {
            Meg += ",邮箱是：" + this.Emil;
        }
        System.out.println(Meg);
    }

    public static void main(String[] args) {
        User user1 = new User(1001,"p123");
        User user2 = new User(1002,"p1234","123456@qq.com");
    }
}
